package com.wsx.springai.mcp;

import com.alibaba.fastjson.JSONObject;
import com.wsx.springai.service.PsNewsService;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.AliasFor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description:
 * @create: 2025-07-16-13:28
 * @athor: wsx
 */
@Service
public class McpService {
    @Autowired
    private PsNewsService psNewsService;

    @Tool(description = "获取某个公司某个月份的新闻列表")
    public List<JSONObject> getCompanyNews(@ToolParam(description = "公司简称") String stockName,
                                       @ToolParam(description = "日期(yyyy-MM)") String date) {
        return psNewsService.getNewsList(stockName,date);
    }


}
